package com.yc.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author zwei
 * @create 2024-05-03 17:27
 */
public class EncryptUtils {
    public static String encryptToMD5(String string) throws NoSuchAlgorithmException {
        MessageDigest md=MessageDigest.getInstance("MD5");
        md.update(string.getBytes());
        String hashePwd=new BigInteger(1,md.digest()).toString(16);
        return hashePwd;
    }
    public static void main(String[] args) throws NoSuchAlgorithmException {
        System.out.println(EncryptUtils.encryptToMD5(EncryptUtils.encryptToMD5("a")));
    }
}
